package com.wisely.highlight_spring4.ch3.conditional;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;


/**
 * @ClassName ConditionalConfig
 * @Description TODO
 * @Author Mike
 * @Date 2018/11/25 20:02
 * @Version 1.0
 */
@Configuration
public class ConditionalConfig {

    @Bean
    @Conditional(WindowCondition.class)
    public ListService windowsListService() {
        return new WindowsListService();
    }

    @Bean
    @Conditional(LinuxCondition.class)
    public ListService linuxListService() {
        return new LinuxListService();
    }

}
